package com.xiaoqi.store.entity;

import java.io.Serializable;

/**
 * @Author Rookie Coder
 * @Description 封装返回的数据信息
 * @Date
 **/
public class JsonResult<T> implements Serializable {

    // 返回信息状态码
    private Integer state;
    // 状态描述信息
    private String message;
    // 数据
    private T data;

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public JsonResult() {
    }

    @Override
    public String toString() {
        return "JsonResult{" +
                "state=" + state +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }

    public JsonResult(Integer state) {
        this.state = state;
    }

    /*
     * @Author xiaoqi
     * @Description  异常描述信息
     * @return
     **/
    public JsonResult(String message) {
        this.message = message;
    }
    
    public JsonResult(Integer state, T data) {
        this.state = state;
        this.data = data;
    }

}
